<#import "/spring.ftl" as spring />

<#include "/tags/userNotification.ftl">
<#include "/tags/userCompleteness.ftl">
<#include "/tags/userIntroTag.ftl">
<#include "/tags/friendList.ftl">
<#include "/tags/friendHintTag.ftl">
<#include "/tags/goalCloudTag.ftl">
<#include "/tags/updatedSinceTag.ftl">
<#include "/tags/commonGoalsTag.ftl">
<#include "/tags/confirmBox.ftl">
<#include "/tags/commentTag.ftl">
<#include "/tags/commentBoxTag.ftl">
<#include "/tags/activitiesTag.ftl">
<#include "/tags/newsItemTag.ftl">
<#include "/tags/mustDoGoalWidget.ftl">
<#include "/tags/randomNewsTag.ftl">
<#include "/tags/tabTag.ftl">

<head>	     	
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/style_dev.css">	
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/jquery.alertbox.css">
	
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.easing.1.3.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.alertbox.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/widget.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/scripts/page.news.js"></script>
	<title>Tin tuc</title>
</head>

<@userNotification />  
<div class="w3"></div>

<div id="infomation">
	<!-- user mustDoGoalWidget -->
	<#if data.mustDoGoal??>
    	<@mustDoGoalWidget data.mustDoGoal.id data.mustDoGoal.title data.mustDoGoal.userCount/>
    </#if>
	<div id="left">
		<@tab page="NEWS" />
        <div class="clearthis"></div>		
        <#if data.randomNews??>
        	<@randomNews data.randomNews.id data.randomNews.title data.randomNews.intro data.randomNews.avatar data.randomNews.SEOLink/>
        </#if>
        <div class="clearthis"></div>
        <@security.authorize ifAnyGranted="ROLE_ADMIN"><a href="${rc.contextPath}/admin/addNews.html"><br/>&nbsp;[Viết bài mới]</a></@security.authorize>                 
        <div class="wallContainer">
        	<#list data.news as news>
        		<#assign avatar=""/>
        		<#if news.avatar??>
        			<#assign avatar=news.avatar/>
        		</#if>
        		<@newsItem avatar news.title news.SEOLink news.updatedSince news.likeCount news.id news.youLikeThis news.intro news.tags news.commentCount/>
        		<#assign lastItem=news/>
        	</#list>     
        	
        	<#if lastItem??>
        		<#assign tagId=""/>
        		<#if RequestParameters.tagId??>
        			<#assign tagId=RequestParameters.tagId/>
        		</#if>
				<div id="next_page_scroll" class="news;${tagId};" rel="${lastItem.sortedValue}" style="float:left"></div>
				<div id="scroll_loader" style="display: none; width: 100%; float: left; padding-top: 30px;">
					<center>
						<img src="${rc.contextPath}/images/loader.gif"/>
					</center>
				</div>
			</#if>   	                  
        </div>
    </div>
    
    <div id="right">
    	<#if data.userInSession??>
			<@userCompleteness />		
			<@userIntro />
	        <@friendList username="${data.userInSession}" />
	        <@friendHint />
			<div class="clearthis"></div>
		<a href="http://igoal.vn/goal/view/335" >
			<img src="http://igoal.vn/photos/banner_baohanhtreem.png" style="margin-top:10px"/>
		</a>
        </#if>
	</div>
</div>